package com.chushouya.manager.dto.admin.menu;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.general.framework.core.enums.StatusEnum;
import com.general.framework.core.lang.Dates;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@ApiModel("菜单列表")
@Data
public class MenuListDTO {

    @ApiModelProperty("菜单ID")
    private Long menuId;

    @ApiModelProperty("父菜单ID")
    private Long parentId;

    @ApiModelProperty("菜单名称")
    private String menuName;


    @ApiModelProperty("菜单类型（M目录 C菜单 F按钮）")
    private String menuType;


    @ApiModelProperty("菜单图标")
    private String icon;

    @ApiModelProperty("显示顺序")
    private Integer orderNum;

    @ApiModelProperty("权限标识")
    private String perms;

    @ApiModelProperty("组件路径")
    private String component;

    @ApiModelProperty("路由地址")
    private String path;

    @ApiModelProperty("菜单状态（1显示 0隐藏）")
    private Integer visible;

    @ApiModelProperty("菜单状态（1正常 0停用）")
    private Integer status;

    @ApiModelProperty("菜单状态（1正常 0停用）")
    private String statusDesc;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    public String getStatusDesc() {
        return StatusEnum.getDesc(this.status);
    }
}
